3.10 \(\int (a+b \sec ^2(e+f x)) \sin ^2(e+f x) \, dx\)

Optimal. Leaf size=42 \[ \frac {1}{2} x (a-2 b)-\frac {a \sin (e+f x) \cos (e+f x)}{2 f}+\frac {b \tan (e+f x)}{f} \]

[Out]

1/2*(a-2*b)*x-1/2*a*cos(f*x+e)*sin(f*x+e)/f+b*tan(f*x+e)/f

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {4132, 455, 388, 203} \[ \frac {1}{2} x (a-2 b)-\frac {a \sin (e+f x) \cos (e+f x)}{2 f}+\frac {b \tan (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sec[e + f*x]^2)*Sin[e + f*x]^2,x]

[Out]

((a - 2*b)*x)/2 - (a*Cos[e + f*x]*Sin[e + f*x])/(2*f) + (b*Tan[e + f*x])/f

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 388

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*x*(a + b*x^n)^(p + 1))/(b*(n*
(p + 1) + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rule 455

Int[(x_)^(m_)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[((-a)^(m/2 - 1)*(b*c - a*d)*
x*(a + b*x^2)^(p + 1))/(2*b^(m/2 + 1)*(p + 1)), x] + Dist[1/(2*b^(m/2 + 1)*(p + 1)), Int[(a + b*x^2)^(p + 1)*E
xpandToSum[2*b*(p + 1)*x^2*Together[(b^(m/2)*x^(m - 2)*(c + d*x^2) - (-a)^(m/2 - 1)*(b*c - a*d))/(a + b*x^2)]
- (-a)^(m/2 - 1)*(b*c - a*d), x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && IGtQ[
m/2, 0] && (IntegerQ[p] || EqQ[m + 2*p + 1, 0])

Rule 4132

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*sin[(e_.) + (f_.)*(x_)]^(m_), x_Symbol] :> With[{ff = Fr
eeFactors[Tan[e + f*x], x]}, Dist[ff^(m + 1)/f, Subst[Int[(x^m*ExpandToSum[a + b*(1 + ff^2*x^2)^(n/2), x]^p)/(
1 + ff^2*x^2)^(m/2 + 1), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[m/2] && Integer
Q[n/2]

Rubi steps

\begin {align*} \int \left (a+b \sec ^2(e+f x)\right ) \sin ^2(e+f x) \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x^2 \left (a+b+b x^2\right )}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {a \cos (e+f x) \sin (e+f x)}{2 f}-\frac {\operatorname {Subst}\left (\int \frac {-a-2 b x^2}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=-\frac {a \cos (e+f x) \sin (e+f x)}{2 f}+\frac {b \tan (e+f x)}{f}+\frac {(a-2 b) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=\frac {1}{2} (a-2 b) x-\frac {a \cos (e+f x) \sin (e+f x)}{2 f}+\frac {b \tan (e+f x)}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.10, size = 54, normalized size = 1.29 \[ \frac {a (e+f x)}{2 f}-\frac {a \sin (2 (e+f x))}{4 f}-\frac {b \tan ^{-1}(\tan (e+f x))}{f}+\frac {b \tan (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sec[e + f*x]^2)*Sin[e + f*x]^2,x]

[Out]

(a*(e + f*x))/(2*f) - (b*ArcTan[Tan[e + f*x]])/f - (a*Sin[2*(e + f*x)])/(4*f) + (b*Tan[e + f*x])/f

________________________________________________________________________________________

fricas [A]  time = 0.68, size = 50, normalized size = 1.19 \[ \frac {{\left (a - 2 \, b\right )} f x \cos \left (f x + e\right ) - {\left (a \cos \left (f x + e\right )^{2} - 2 \, b\right )} \sin \left (f x + e\right )}{2 \, f \cos \left (f x + e\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)*sin(f*x+e)^2,x, algorithm="fricas")

[Out]

1/2*((a - 2*b)*f*x*cos(f*x + e) - (a*cos(f*x + e)^2 - 2*b)*sin(f*x + e))/(f*cos(f*x + e))

________________________________________________________________________________________

giac [A]  time = 0.26, size = 51, normalized size = 1.21 \[ \frac {{\left (f x + e\right )} {\left (a - 2 \, b\right )} + 2 \, b \tan \left (f x + e\right ) - \frac {a \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)*sin(f*x+e)^2,x, algorithm="giac")

[Out]

1/2*((f*x + e)*(a - 2*b) + 2*b*tan(f*x + e) - a*tan(f*x + e)/(tan(f*x + e)^2 + 1))/f

________________________________________________________________________________________

maple [A]  time = 0.72, size = 46, normalized size = 1.10 \[ \frac {a \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+b \left (\tan \left (f x +e \right )-f x -e \right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sec(f*x+e)^2)*sin(f*x+e)^2,x)

[Out]

1/f*(a*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)+b*(tan(f*x+e)-f*x-e))

________________________________________________________________________________________

maxima [A]  time = 0.45, size = 47, normalized size = 1.12 \[ \frac {{\left (f x + e\right )} {\left (a - 2 \, b\right )} + 2 \, b \tan \left (f x + e\right ) - \frac {a \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)*sin(f*x+e)^2,x, algorithm="maxima")

[Out]

1/2*((f*x + e)*(a - 2*b) + 2*b*tan(f*x + e) - a*tan(f*x + e)/(tan(f*x + e)^2 + 1))/f

________________________________________________________________________________________

mupad [B]  time = 4.24, size = 35, normalized size = 0.83 \[ \frac {b\,\mathrm {tan}\left (e+f\,x\right )-\frac {a\,\sin \left (2\,e+2\,f\,x\right )}{4}+f\,x\,\left (\frac {a}{2}-b\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(e + f*x)^2*(a + b/cos(e + f*x)^2),x)

[Out]

(b*tan(e + f*x) - (a*sin(2*e + 2*f*x))/4 + f*x*(a/2 - b))/f

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sec ^{2}{\left (e + f x \right )}\right ) \sin ^{2}{\left (e + f x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)**2)*sin(f*x+e)**2,x)

[Out]

Integral((a + b*sec(e + f*x)**2)*sin(e + f*x)**2, x)

________________________________________________________________________________________